<?php

class KgridList
{
	

function ajaxkgridlist($strAction, $strarraysearch, $strmachsearch, $intCurrentPage, $strSortField, $intSkipCount, $intRowID, $strPKIDNEW, $strReinitialise)
{

//NOTE:-  Using by default 2 Search criteria (ie $strarraysearch, $strmachsearch).
//        If using more than 2, then Please change several places in code below.


//Change next line for page size
global $intPageSize;
$intPageSize = 10;

$strInnerAction = "";
$strpageload = "";
//global $strDispTotals;

$strchkresetcriteria = "";
    

//echo "OK";
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//Add Search criteria, or comment out if not using search criteria (can leave in)
  
  if ($strarraysearch == ""
            || strlen($strarraysearch) == 0)
  {
            //nothing
  }
  else
  {
             $strarraysearch = $strarraysearch;
            //$strarraysearch = $strarraysearch.Replace("'", "''");                     //so as to cope with any Apostrophes in text
  }

 
  if ($strmachsearch == ""
            || strlen($strmachsearch) == 0)
  {
            //nothing
  }
  else
  {
             $strmachsearch = $strmachsearch;
            //$strmachsearch = $strmachsearch.Replace("'", "''");                     //so as to cope with any Apostrophes in text
  }
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&



        //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        //Get Total Page count and Total Record count, to store hidden on Page
        //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
        //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
        $intTotalNoRecords = $this->Get_Total_Records($strarraysearch, $strmachsearch);

        $intTotalPages = ($intTotalNoRecords / $intPageSize);
        //Adjust the page count if the last page contains a partial page.
        if (($intTotalNoRecords % $intPageSize) > 0)
        {
            $intTotalPages = ($intTotalPages + 1);
            $intTotalPages = Floor($intTotalPages);
        }

        //STORE Total HIDDEN values ready to display
        $strDispTotals = $this->DispTotalInfo($intTotalPages, $intTotalNoRecords);
        //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        //END Get Total Page count and Total Record count
        //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


//echo "After Count OK";
//echo $intTotalNoRecords;
//echo $intTotalPages;
//echo $strDispTotals;

//Processing from UPDATE where we want to display record on first page on TOP
if ($intCurrentPage == -1)
{
  $strAction = "firstpage";
}
//END Processing from UPDATE where we want to display record on first page on TOP




        if (($intTotalNoRecords > 0))
        {
            switch ($strAction)
            {
                case "firstpage":
                    //echo "in firstpage";
                    $intRowID = 0;
                    $intSkipCount = 0;
                    // STORE Page Counts HIDDEN values ready to display
                    $strDispPageCounts = $this->DispPageCountInfo($intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
                    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                    //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
                    $this->DisplayFirstPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);
                    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                    break;
                case "nextpage":
		    if ($intCurrentPage == $intTotalPages)
                    {
                        $intRowID = 0;
                        $intSkipCount = (($intTotalPages - 1) * $intPageSize);
                        $intCurrentPage = $intTotalPages;
                        // STORE Page Counts HIDDEN values ready to display
                        $strDispPageCounts = $this->DispPageCountInfo($intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
                        $this->NextPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);
                    }
                    else
                    {
                        $intCurrentPage = ($intCurrentPage + 1);
                        $intRowID = 0;
                        // Workout SkipCount of records, for next page
                        $intSkipCount = ($intSkipCount + $intPageSize);
                        // STORE Page Counts HIDDEN values ready to display
                        $strDispPageCounts = $this->DispPageCountInfo($intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
                        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                        //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
                        $this->NextPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);
                        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                    }
                    break;
                case "prevpage":
		    if ($intCurrentPage == 1)
                    {
                        $intRowID = 0;
                        $intSkipCount = 0;
                        $intCurrentPage = 1;
                        // STORE Page Counts HIDDEN values ready to display
                        $strDispPageCounts = $this->DispPageCountInfo($intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
                        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                        //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
                        $this->DisplayFirstPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);
                        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                    }
                    else
                    {
                        $intCurrentPage = ($intCurrentPage - 1);
                        $intRowID = 0;
                        $intSkipCount = ($intSkipCount - $intPageSize);
                        // STORE Page Counts HIDDEN values ready to display
                        $strDispPageCounts = $this->DispPageCountInfo($intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
                        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                        //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
                        $this->PrevPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);
                        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                    }
                    break;
                case "lastpage":
		    if ($intCurrentPage == $intTotalPages)
                    {
                        $intRowID = 0;
                        $intSkipCount = (($intTotalPages - 1) * $intPageSize);
                        $intCurrentPage = $intTotalPages;
                        // STORE Page Counts HIDDEN values ready to display
                        $strDispPageCounts = $this->DispPageCountInfo($intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
                        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                        //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
                        $this->NextPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);
                        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                      
                    }
                    else
                    {
                        $intCurrentPage = $intTotalPages;
                        $intRowID = 0;
                        $intSkipCount = (($intTotalPages - 1) * $intPageSize);
                        // STORE Page Counts HIDDEN values ready to display
                        $strDispPageCounts = $this->DispPageCountInfo($intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
                        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                        //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
                        $this->NextPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);
                        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                    }
                    break;
                case "pageid":
                    $intRowID = 0;
                    $intSkipCount = (($intCurrentPage * $intPageSize) - $intPageSize);
                    // STORE Page Counts HIDDEN values ready to display
                    $strDispPageCounts = $this->DispPageCountInfo($intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
                    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                    //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
                    $this->NextPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);
                    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                    break;
                case "GetCurrentPage":
                    $strchkresetcriteria = $strReinitialise;
                    $strDispPageCounts = $this->DispPageCountInfo($intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
                    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                    //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
                    $this->NextPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);
                    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                    break;
                default:
                    $intSkipCount = 0;
                    $intCurrentPage = 1;
                    $intRowID = 0;
                    // STORE Page Counts HIDDEN values ready to display
                    $strDispPageCounts = $this->DispPageCountInfo($intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
                    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                    //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
                    $this->DisplayFirstPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);
                    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                    break;
            }


            // DISPLAY OUTPUT to go BACK (to innerHTML of Requested Page)
            $strDispSEARCH = $this->DispSEARCHInfo($strchkresetcriteria);
            echo $strDispSEARCH;
            echo $strDispPageCounts;
            echo $strDispTotals;
            //echo $strDispSortDirection;

            // *************************************************************************************************************************************************************
            // This next Part is for writing out to a HTML page so as to see Layout Design
            // USED ONLY FOR TESTING
            //string FILENAME = Server.MapPath("Output.html");
            //StreamWriter objStreamWriter;
            //objStreamWriter = File.AppendText(FILENAME);
            //objStreamWriter.WriteLine(strNavTable);
            //objStreamWriter.WriteLine(strHeaderTable);
            //objStreamWriter.WriteLine(strDataTable);
            //objStreamWriter.Close();
            // *************************************************************************************************************************************************************
        }
        else
        {
            // No records found
            $intSkipCount = 0;
            $intCurrentPage = 1;
            $intRowID = 0;
            $strNavTable = "";
            $strHeaderTable = "";
            //GetHeaderTable();
            $strDataTable = "";
            $strDispPKID = "";
            $strDispSEARCH = "";
            $strDispPageCounts = "";
            $strDispTotals = "";

            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //Change next line to Sort default
            $strSortField = "PK_ID";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

            $strchkresetcriteria = "No Records";
            $strDispSEARCH = $this->DispSEARCHInfo($strchkresetcriteria);
            $strDispPageCounts = $this->DispPageCountInfo($intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
            $strPKIDNEW = "0";
            $strDispPKID = $this->DispPKIDInfo($strPKIDNEW);
            echo $strDispPageCounts;
            echo $strDispTotals;
            echo $strDispSortDirection;
            echo $strDispSEARCH;
            // echo $strHeaderTable;    'Optional taking out Header display
            echo $strDispPKID;
        }
        // If intTotalNoRecords > 0

    }






    //--------------------------------------------------------------------------------------------------------------------------------------------------------------
    //These next 5 Functions are used to keep internal variables, and so are MANDATORY
    // NOTE:-  Can change type=hidden  -->   type=text, for displaying variables below
    //--------------------------------------------------------------------------------------------------------------------------------------------------------------
    function DispTotalInfo($TotalPages, $TotalNoRecords)
    {
        //$cRet;
        $cRet = "";
        $cRet = $cRet . "<input name='TotalPages' id='TotalPages' type='hidden' value='" . $TotalPages . "' />" . "\r\n";      
        $cRet = $cRet . "<input name='TotalNoRecords' id='TotalNoRecords' type='hidden' value='" . $TotalNoRecords . "' />" . "\r\n";
        return $cRet;
    }

    function DispPageCountInfo($PageSize, $CurrentPage, $RowID, $SkipCount, $SortField)
    {
        //$cRet;
        $cRet = "";
        $cRet = $cRet . "<input name='CurrentPageGet' id='CurrentPageGet' type='hidden' value='" . $CurrentPage . "' />" . "\r\n";
        $cRet = $cRet . "<input name='RowIDGet' id='RowIDGet' type='hidden' value='" . $RowID . "' />" . "\r\n";
        $cRet = $cRet . "<input name='SkipCount' id='SkipCount' type='hidden' value='" . $SkipCount . "' />" . "\r\n";
        $cRet = $cRet . "<input name='PageSizeGet' id='PageSizeGet' type='hidden' value='" . $PageSize . "' />" . "\r\n";
        $cRet = $cRet . "<input name='SortFieldGet' id='SortFieldGet' type='hidden' value='" . $SortField . "' />" . "\r\n";
        return $cRet;
    }

    function DispPKIDInfo($PKID)
    {
        //$cRet;
        $cRet = "";
        $cRet = $cRet . "<input name='textcurrentpkid' id='textcurrentpkid' type='hidden' value='"
                    . $PKID . "' />" . "\r\n";
        return $cRet;
    }

    function DispSEARCHInfo($chkresetcriteria)
    {
        //$cRet;
        $cRet = "";
        $cRet = $cRet . "<input name='chkresetcriteria' id='chkresetcriteria' type='hidden' value='"
                    . $chkresetcriteria . "' />" . "\r\n";
        return $cRet;
    }
    
    //--------------------------------------------------------------------------------------------------------------------------------------------------------------
    // END of 5 Functions are used to keep internal variables, and so are MANDATORY
    //--------------------------------------------------------------------------------------------------------------------------------------------------------------






    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
    //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
    function Get_Total_Records($strarraysearch, $strmachsearch)
    {
        // ------------------------------------------------------------------------------------------- 
        $intwherecounter = 0;
        $intCounter = 0;
        //SqlCommand objCmd;
        $strSQL = "";
         
        //odbc connection
        $dsn2="SQLSERVER2005";
        $username2="sa";
        $password2="and";
    
        $sqlconnect2=odbc_connect($dsn2,$username2,$password2);


        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
        $strSQL = "SELECT count(*) as Cnt from ARRAYS2 ";
        $intwherecounter = 0;
        if ($strarraysearch == ""
                    || (strlen($strarraysearch) == 0))
        {
            // nothing to Search
        }
        else
        {
            // NOTE:- To make faster, put % only at end
            $strSQL = $strSQL . " WHERE Array_Name like '%"
                        . $strarraysearch . "%'";
            $intwherecounter = 1;
        }

        if ($strmachsearch == ""
                    || (strlen($strmachsearch) == 0))
        {
            // nothing to Search
        }
        else if (($intwherecounter == 1))
        {
            $strSQL = ($strSQL . (" AND Loaded_Machine = '"
                        . ($strmachsearch . "'")));
        }
        else
        {
            $strSQL = $strSQL . " WHERE Loaded_Machine = '"
                        . $strmachsearch . "'";
        }
        // &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

        //echo $strSQL;

        $rs=odbc_exec($sqlconnect2, $strSQL);


        //if (!$rs)
        // {
        //    echo "error in Connecting to do Count";
        // }

         while (odbc_fetch_row($rs))
         {
            //$intCounter = $rs(0);
            //$intCounter = $intCounter + 1;
            $intCounter = odbc_result($rs,"Cnt");
         }

        odbc_close($sqlconnect2);

        
         //echo $intCounter;

        return $intCounter;

    }



    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
    //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
    function DisplayFirstPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW)
    {
        //echo "in Displayfirstpage";
        // STORE Page Counts HIDDEN values ready to display
        $strDispPageCounts = $this->DispPageCountInfo($intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);

        $this->GetHeaderTable($strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
        $this->GetPageOfRecords($strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);          // global subroutine
       
        //strbtnPreviousPage = "disabled='disabled'";
        //strbtnFirstPage = "disabled='disabled'";
        $strbtnPreviousPage = "hidden";
        $strbtnFirstPage = "hidden";
        $strbtnNextPage = "";
        $strbtnLastPage = "";

        $strlblCurrentPage = $this->DisplayPageInfo($intCurrentPage, $intTotalPages, $intTotalNoRecords);               // global subroutine
        $this->GetNavigationTable($strbtnPreviousPage, $strbtnFirstPage, $strbtnNextPage, $strbtnLastPage, $intTotalPages, $strlblCurrentPage, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
    }


    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
    //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
    function NextPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW)
    {
        // Check if on First Page
        if (($intCurrentPage == 1))
        {
            // at first page
            $this->DisplayFirstPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);
        }
        else
        {
         //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
         //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
         $this->GetHeaderTable($strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
         $this->GetPageOfRecords($strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);
         //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
       
         if (($intCurrentPage == $intTotalPages))
         {
            // at last page
            $strbtnNextPage = "hidden";
            $strbtnLastPage = "hidden";
            $strbtnPreviousPage = "";
            $strbtnFirstPage = "";
         }
         else
         {
            $strbtnNextPage = "";
            $strbtnLastPage = "";
            $strbtnPreviousPage = "";
            $strbtnFirstPage = "";
         }

         $strlblCurrentPage = $this->DisplayPageInfo($intCurrentPage, $intTotalPages, $intTotalNoRecords);               // global subroutine
         $this->GetNavigationTable($strbtnPreviousPage, $strbtnFirstPage, $strbtnNextPage, $strbtnLastPage, $intTotalPages, $strlblCurrentPage, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);

        }

    }


    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
    //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
    function PrevPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW)
    {
        // Check if on First Page
        if (($intCurrentPage == 1))
        {
            // at first page
            $this->DisplayFirstPage($intTotalPages, $intTotalNoRecords, $strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);
        }
        else
        {
         //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
         //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
         $this->GetHeaderTable($strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);
         $this->GetPageOfRecords($strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW);
         //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

         $strbtnPreviousPage = "";
         $strbtnFirstPage = "";
         $strbtnNextPage = "";
         $strbtnLastPage = "";

         $strlblCurrentPage = $this->DisplayPageInfo($intCurrentPage, $intTotalPages, $intTotalNoRecords);               // global subroutine
         $this->GetNavigationTable($strbtnPreviousPage, $strbtnFirstPage, $strbtnNextPage, $strbtnLastPage, $intTotalPages, $strlblCurrentPage, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField);

        }

    }


    function DisplayPageInfo($intCurrentPage, $intTotalPages, $intTotalNoRecords)
    {
         
        $strlblCurrentPage = "";
        $strlblCurrentPage = "Page: " . $intCurrentPage . "  of  " . $intTotalPages .
                              "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" .
                              "" . $intTotalNoRecords . " Records"; 
        return $strlblCurrentPage;
    }


    function GetNavigationTable($strbtnPreviousPage, $strbtnFirstPage, $strbtnNextPage, $strbtnLastPage, $intTotalPages, $strlblCurrentPage, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField)
    {

        if ((($intTotalPages == 1)
                    || ($intTotalPages == 0)))
        {
            $strbtnNextPage = "hidden";
            $strbtnLastPage = "hidden";
            $strbtnPreviousPage = "hidden";
            $strbtnFirstPage = "hidden";
        }


        //  This displays navigation buttons (ie First Page, Next, Prev, Last Page)
        //  Can be modified to suit
        // -------------------------------------------------------------------------------------------------------------------------------------------------------------
      
        $intPageCnt = 0;
        global $strNavTable;
        $strNavTable = "";

        $strNavTable = $strNavTable . "<div" . "\r\n";
        $strNavTable = $strNavTable . " style='BORDER-TOP: 1px solid white;" . "\r\n";
        $strNavTable = $strNavTable . " BORDER-BOTTOM: 1px solid white;" . "\r\n";
        $strNavTable = $strNavTable . " BORDER-LEFT: 1px solid white;" . "\r\n";
        $strNavTable = $strNavTable . " BORDER-RIGHT: 1px solid white'>" . "\r\n";
        $strNavTable = $strNavTable . "</div>" . "\r\n";

        $strNavTable = $strNavTable . "<table id='myNav' border='0' bgcolor='#006699' bordercolor='gray' cellspacing='0' cellpadding='0'  width='682" . "px'>" . "\r\n";
        //$strNavTable = $strNavTable . "<tr>" . "\r\n";
        //$strNavTable = $strNavTable . "<td>" . "\r\n";
        // $strNavTable = $strNavTable . " " . "\r\n";
        //$strNavTable = $strNavTable . "</td>" . "\r\n";
        //$strNavTable = $strNavTable . "</tr>" . "\r\n";
        //$strNavTable = $strNavTable . "<tr>" . "\r\n";
        //$strNavTable = $strNavTable . "<td>" . "\r\n";
        //$strNavTable = $strNavTable . "<span id=\'lblMessage\' tabindex=\'-1\'></span>" . "\r\n";
        //$strNavTable = $strNavTable . "</td>" . "\r\n";
        //$strNavTable = $strNavTable . "</tr>" . "\r\n";
        $strNavTable = $strNavTable . "<tr>" . "\r\n";
        $strNavTable = $strNavTable . "<td width='240px' " . "\r\n";
        $strNavTable = $strNavTable . " style='FONT-SIZE: 12px;" . "\r\n";
        $strNavTable = $strNavTable . " FONT-FAMILY: Arial;" . "\r\n";
        $strNavTable = $strNavTable . " COLOR: white;" . "\r\n";
        $strNavTable = $strNavTable . " PADDING: 2px';" . "\r\n";
        $strNavTable = $strNavTable . " BORDER-RIGHT: 1px solid gray'>" . "\r\n";
        
        $strNavTable = $strNavTable . "<span id='lblCurrentPage' tabindex='-1'>" . $strlblCurrentPage . "</span>" . "\r\n";
        $strNavTable = $strNavTable . "</td>" . "\r\n";
        $strNavTable = $strNavTable . "<td align='right' width=10px" . "\r\n";
        $strNavTable = $strNavTable . " style='FONT-SIZE: 12px;" . "\r\n";
        $strNavTable = $strNavTable . " FONT-FAMILY: Arial;" . "\r\n";
        $strNavTable = $strNavTable . " COLOR: white;" . "\r\n";
        $strNavTable = $strNavTable . " PADDING: 0px'>" . "\r\n";

        // ............................................................................................................................................................................................................................................
        // FIRST PAGE Button
        // ............................................................................................................................................................................................................................................
        // Note:- Non image button alternative commented out
        //$strNavTable = $strNavTable . "<input type=\'submit\' name=\'btnFirstPage\' value=\'<<\' id=\'btnFirstPage\' " . $strbtnFirstPage . " tabindex=\'-1\' " . "\r\n";
        //$strNavTable = $strNavTable . " onclick=\'javascript: initload" . '"' . $strSortField . '"' . ";return false;\' " . " />" . "\r\n";
        if ($strbtnFirstPage != "hidden")
        {
            $strNavTable = $strNavTable . "<a id='navigat' href='javascript: FirstPageit(" . '"' . $strSortField . '"' . ")'>" . "\r\n";
            //$strNavTable = $strNavTable . " <img SRC=\'images/FIRST_09.gif\' ALT=\'First Page\' " . "\r\n";
            //$strNavTable = $strNavTable . "  WIDTH=\'22\' HEIGHT=\'20\' border=\'0\'>" . "\r\n";
            // $strNavTable = $strNavTable . " <img SRC=\'images/FIRST_10.gif\' ALT=\'First Page\' " . "\r\n";
            //$strNavTable = $strNavTable . "  WIDTH=\'23\' HEIGHT=\'25\' border=\'0\'>" . "\r\n";
            $strNavTable = $strNavTable . " << " . "\r\n";

            $strNavTable = $strNavTable . " </a>" . " " . "\r\n";
        }
        
        $strNavTable = $strNavTable . "</td>" . "\r\n";
        $strNavTable = $strNavTable . "<td width=16px" . "\r\n";
        $strNavTable = $strNavTable . " style='FONT-SIZE: 12px;" . "\r\n";
        $strNavTable = $strNavTable . " FONT-FAMILY: Arial;" . "\r\n";
        $strNavTable = $strNavTable . " COLOR: white;" . "\r\n";
        $strNavTable = $strNavTable . " PADDING: 0px'>" . "\r\n";
        
        // ............................................................................................................................................................................................................................................
        // PREVIOUS PAGE Button
        // ............................................................................................................................................................................................................................................
        // Note:- Non image button alternative commented out
        //$strNavTable = $strNavTable . "<input type=\'submit\' name=\'btnPreviousPage\' value=\'<\' id=\'btnPreviousPage\' " . $strbtnPreviousPage . " tabindex=\'-1\' " . "\r\n";
        //$strNavTable = $strNavTable . " onclick=\'javascript: PrevPageit" . '"' . intCurrentPage . '"' . ",";
        //$strNavTable = $strNavTable . '"' . $strSortField . '"' . ",";
        //$strNavTable = $strNavTable . '"' . $intSkipCount . '"' . ";return false;\' " . " />" . "\r\n";
        if ($strbtnPreviousPage != "hidden")
        {
            $strNavTable = $strNavTable . "<a id='navigat' href='javascript: PrevPageit(" . '"' . $intCurrentPage . '"' . ",";
            $strNavTable = $strNavTable . '"' . $strSortField . '"' . ",";
            $strNavTable = $strNavTable . '"' . $intSkipCount . '"' . ")' " . " >" . "\r\n";
            //$strNavTable = $strNavTable . " <img SRC=\'images/PREV_09.gif\' ALT=\'Previous Page\' " . "\r\n";
            //$strNavTable = $strNavTable . "  WIDTH=\'17\' HEIGHT=\'20\' border=\'0\'>" . "\r\n";
            //$strNavTable = $strNavTable . " <img SRC=\'images/PREV_10.gif\' ALT=\'Previous Page\' " . "\r\n";
            //$strNavTable = $strNavTable . "  WIDTH=\'15\' HEIGHT=\'25\' border=\'0\'>" . "\r\n";
            $strNavTable = $strNavTable . " Prev " . "\r\n";
            $strNavTable = $strNavTable . " </a>" . " " . "\r\n";
        }
        
        $strNavTable = $strNavTable . "</td>" . "\r\n";
        $strNavTable = $strNavTable . "<td width=16px" . "\r\n";
        $strNavTable = $strNavTable . " style='FONT-SIZE: 12px;" . "\r\n";
        $strNavTable = $strNavTable . " FONT-FAMILY: Arial;" . "\r\n";
        $strNavTable = $strNavTable . " COLOR: white;" . "\r\n";
        $strNavTable = $strNavTable . " PADDING: 0px'>" . "\r\n";
        
        // ............................................................................................................................................................................................................................................
        // NEXT PAGE Button
        // ............................................................................................................................................................................................................................................
        // Note:- Non image button alternative commented out
        //$strNavTable = $strNavTable . "<input type=\'submit\' name=\'btnNextPage\' value=\'>\' id=\'btnNextPage\' " . $strbtnNextPage . " tabindex=\'-1\' " . "\r\n";
        //$strNavTable = $strNavTable . " onclick=\'javascript: NextPageit" . '"' . $intCurrentPage . '"' . ",";
        //$strNavTable = $strNavTable . '"' . $strSortField . '"' . ",";
        //$strNavTable = $strNavTable . '"' . $intSkipCount . '"' . ";return false;\' " . " />" . "\r\n";
        if ($strbtnNextPage != "hidden")
        {
            $strNavTable = $strNavTable . "<a id='navigat' href='javascript: NextPageit(" . '"' . $intCurrentPage . '"' . ",";
            $strNavTable = $strNavTable . '"' . $strSortField . '"' . ",";
            $strNavTable = $strNavTable . '"' . $intSkipCount . '"' . ")' " . " >" . "\r\n";
            //$strNavTable = $strNavTable . " <img SRC=\'images/NEXT_09.gif\' ALT=\'Next Page\' " . "\r\n";
            //$strNavTable = $strNavTable . "  WIDTH=\'17\' HEIGHT=\'20\' border=\'0\'>" . "\r\n";
            //$strNavTable = $strNavTable . " <img SRC=\'images/NEXT_10.gif\' ALT=\'Next Page\' " . "\r\n";
            //$strNavTable = $strNavTable . "  WIDTH=\'15\' HEIGHT=\'25\' border=\'0\'>" . "\r\n";
            $strNavTable = $strNavTable . " Next " . "\r\n";
            $strNavTable = $strNavTable . " </a>" . " " . "\r\n";
        }
        
        $strNavTable = $strNavTable . "</td>" . "\r\n";
        $strNavTable = $strNavTable . "<td width=1px" . "\r\n";
        $strNavTable = $strNavTable . " style='FONT-SIZE: 12px;" . "\r\n";
        $strNavTable = $strNavTable . " FONT-FAMILY: Arial;" . "\r\n";
        $strNavTable = $strNavTable . " COLOR: white;" . "\r\n";
        $strNavTable = $strNavTable . " PADDING: 0px'>" . "\r\n";
        
        // ............................................................................................................................................................................................................................................
        // LAST PAGE Button
        // ............................................................................................................................................................................................................................................
        // Note:- Non image button alternative commented out
        //$strNavTable = $strNavTable . "<input type=\'submit\' name=\'btnLastPage\' value=\'>>\' id=\'btnLastPage\' " . $strbtnLastPage . " tabindex=\'-1\' " . "\r\n";
        //$strNavTable = $strNavTable . " onclick=\'javascript: LastPageit" . '"' . $intCurrentPage . '"' . ",";
        //$strNavTable = $strNavTable . '"' . strSortField . '"' . ",";
        //$strNavTable = $strNavTable . '"' . intSkipCount . '"' . ";return false;\' " . " />" . "\r\n";
        if ($strbtnLastPage != "hidden")
        {
            $strNavTable = $strNavTable . "<a id='navigat' href='javascript: LastPageit(" . '"' . $intCurrentPage . '"' . ",";
            $strNavTable = $strNavTable . '"' . $strSortField . '"' . ",";
            $strNavTable = $strNavTable . '"' . $intSkipCount . '"' . ")' " . " >" . "\r\n";
            //$strNavTable = $strNavTable . " <img SRC=\'images/LAST_09.gif\' ALT=\'Last Page\' " . "\r\n";
            //$strNavTable = $strNavTable . "  WIDTH=\'21\' HEIGHT=\'20\' border=\'0\'>" . "\r\n";
            //$strNavTable = $strNavTable . " <img SRC=\'images/LAST_10.gif\' ALT=\'Last Page\' " . "\r\n";
            //$strNavTable = $strNavTable . "  WIDTH=\'23\' HEIGHT=\'25\' border=\'0\'>" . "\r\n";
            $strNavTable = $strNavTable . " >> " . "\r\n";
            $strNavTable = $strNavTable . " </a> " . "\r\n";
        }

        $strNavTable = $strNavTable . "</td>" . "\r\n";
        $strNavTable = $strNavTable . "<td width=282px" . "\r\n";
        $strNavTable = $strNavTable . " style='FONT-SIZE: 12px;" . "\r\n";
        $strNavTable = $strNavTable . " FONT-FAMILY: Arial;" . "\r\n";
        $strNavTable = $strNavTable . " COLOR: white;" . "\r\n";
        $strNavTable = $strNavTable . " PADDING: 0px'>" . "\r\n";
        
        
        //echo $strNavTable;

        //for intPageCnt = 1; intPageCnt <= intTotalPages; intPageCnt..
        //{
            //if intPageCnt == 1
            //{
            //    //$strNavTable = $strNavTable . " " . "<a id=\'LinkButton1\' tabindex=\'-1\' href=\'javascript:PageID" . '"' . "1" . '"' . "," . '"' 
                //            . strSortField . '"' . "\'>1</a> " . " ";
            //}
            //if intPageCnt == 2
           //{
                //$strNavTable = $strNavTable . "<a id=\'LinkButton2\' tabindex=\'-1\' href=\'javascript:PageID" . '"' . "2" . '"' . "," . '"' 
            //              . strSortField . '"' . "\'>2</a> " . " ";
            //}
            //if intPageCnt == 3
            //{
                //$strNavTable = $strNavTable . "<a id=\'LinkButton3\' tabindex=\'-1\' href=\'javascript:PageID" . '"' . "3" . '"' . "," . '"' 
                //            . strSortField . '"' . "\'>3</a> " . " ";
            //}
            //if intPageCnt == 4
            //{
                // $strNavTable = $strNavTable . "<a id=\'LinkButton4\' tabindex=\'-1\' href=\'javascript:PageID" . '"' . "4" . '"' . "," . '"' 
                //              . strSortField . '"' . "\'>4</a> " . " ";
            //}
            //if intPageCnt == 5
            //{
                // $strNavTable = $strNavTable . "<a id=\'LinkButton3\' tabindex=\'-1\' href=\'javascript:PageID" . '"' . "5" . '"' . "," . '"' 
                //          . strSortField . '"' . "\'>5</a> " . " ";
           //}
            //if intPageCnt == 6
            //{
                // $strNavTable = $strNavTable . "<a id=\'LinkButton4\' tabindex=\'-1\' href=\'javascript:PageID" . '"' . "6" . '"' . "," . '"' 
                //           . strSortField . '"' . "\'>6</a> " . " ";
           // }
        //}


        //$strNavTable = $strNavTable . "<a id=\'LinkButton1\' tabindex=\'-1\' href=\'javascript:PageID" . '"' . "1" . '"' . "," . '"' . strSortField . '"' . "\'>1</a> " . " ";
        //$strNavTable = $strNavTable . "<a id=\'LinkButton2\' tabindex=\'-1\' href=\'javascript:PageID" . '"' . "2" . '"' . "," . '"' . strSortField . '"' . "\'>2</a> " . " ";
        //$strNavTable = $strNavTable . "<a id=\'LinkButton3\' tabindex=\'-1\' href=\'javascript:PageID" . '"' . "3" . '"' . "," . '"' . strSortField . '"' . "\'>3</a> " . " ";
        //$strNavTable = $strNavTable . "<a id=\'LinkButton4\' tabindex=\'-1\' href=\'javascript:PageID" . '"' . "4" . '"' . "," . '"' . strSortField . '"' . "\'>4</a> " . " ";

        $strNavTable = $strNavTable . "</td>" . "\r\n";
        $strNavTable = $strNavTable . "</tr>" . "\r\n";
        $strNavTable = $strNavTable . "</table>" . "\r\n";

        echo $strNavTable;
    }




    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
    //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
    function GetPageOfRecords($strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField, $strPKIDNEW)
    {
        //echo "in GetPageOfRecords";
        $intcounter = 0;
        $intwherecounter = 0;
        $introwcounter = 0;
        $intsubcounter = 0;
        $strSQL = "";
        $strBoolean = "";
        $strStartDate = "";
        $strEndDate = "";
        $strFlag = "";
        $strsize2 = "";
        $strdatename = "";
        $strPK = "";
        $strsort = "";
        $strFields = "";
        $strfiltercheck = "";
        $strfilter = "";
        $strsimplefilter = "";
        $strTable = "";
        $ws_conv_datestring = "";
        //DateTime ws_conv_date;



        global $strDataTable;
        $strDataTable = "";

        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
        //Must change Table width to suit Columns (always make a longer than actual calculation)
        //----------------------------------------------------------------------------------------------------------
        $strDataTable = $strDataTable . "<table id='myTable' border='1' bgcolor='white' bordercolor='gray' cellspacing='0' cellpadding='0'  width='682" . "px'>" . "\r\n";
        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&



        $dsn="SQLSERVER2005";
        $username="sa";
        $password="and";
    


       //==============================================================================================================
       //DOING Showing updated record on TOP if BIG Table  using $strPKIDNEW  as PKID to search
       if ($intCurrentPage == 1)
       //if ($intCurrentPage == -1)
       {
           $intcounter = 99;

           $sqlconnect2=odbc_connect($dsn,$username,$password);
           $strSQL2 = "SELECT * FROM ARRAYS2 ";                             //customise to your Table
           $strSQL2 = $strSQL2 . "WHERE PK_ID = " . $strPKIDNEW . "";
           
           $process2=odbc_exec($sqlconnect2, $strSQL2);

           while(odbc_fetch_row($process2))
        //while (objDR.Read())
        {

            //Setup ROW
            $strDataTable = $strDataTable . "<tr>" . "\r\n";


            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //NOTE:- OPTIONAL - Can use hypertext on other columns instead (Also must adjust Table width size again)
            //DETAIL Column, PK_ID may have to change
            //-----------------------------------------------------
            //$strDataTable = $strDataTable . "<td ALIGN=center WIDTH=17px HEIGHT=21px" . vbCRLF
            //$strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid black;" . vbCRLF
            //$strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid black;" . vbCRLF
            //$strDataTable = $strDataTable . " BORDER-LEFT: 1px solid black;" . vbCRLF
            //$strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid black'>" . vbCRLF
            //$strDataTable = $strDataTable . "<a href='JavaScript: Detail1(" . chr(34) . objDR.Item("PK_ID") . chr(34) . "," . chr(34) . $intcounter . chr(34) .  "," 
            //$strDataTable = $strDataTable . chr(34) . $intCurrentPage . chr(34) . "," . chr(34) . $intSkipCount . chr(34) . "," 
            //$strDataTable = $strDataTable . chr(34) . $strSortField . chr(34) . "," . chr(34) . $intPageSize . chr(34) . ")' " . " tabIndex='-1' title='Title' " .  " >" . vbCRLF
            //     $strDataTable = $strDataTable . " <img SRC='./images/DETAIL_04.gif' ALT='Array Details' TITLE='Array Details' WIDTH=50px HEIGHT=21px border='0'> " . vbCRLF
            //$strDataTable = $strDataTable . " <img SRC='./images/DETAIL_08.bmp' ALT='Array Details' TITLE='Array Details' WIDTH=8px HEIGHT=13px border='0'> " . vbCRLF
            //$strDataTable = $strDataTable . "</a>" . vbCRLF
            //$strDataTable = $strDataTable . "</td>" . vbCRLF

            $strDataTable = $strDataTable . "<td ALIGN='center' WIDTH='45px' HEIGHT='21px'" . "\r\n";
            $strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-SIZE: 11px;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-FAMILY: Arial;" . "\r\n";
            $strDataTable = $strDataTable . " COLOR: navy;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid white'>" . "\r\n";
            $strDataTable = $strDataTable . "<a href='JavaScript: Detail1(" . '"' . odbc_result($process2,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Title' " . " >" . "\r\n";
            //$strDataTable = $strDataTable . " <img SRC='./images/DETAIL_04.gif' ALT='Array Details' TITLE='Array Details' WIDTH=50px HEIGHT=21px b" ."order='0'> " . "\r\n";
            //$strDataTable = $strDataTable . " <img SRC='./images/DETAIL_08.bmp' ALT='Array Details' TITLE='Array Details' WIDTH=8px HEIGHT=13px bo" ."rder='0'> " . "\r\n";
            $strDataTable = $strDataTable . "EDIT" . "\r\n";
            //$strDataTable = $strDataTable . "  " . "<font SIZE='1' FACE='Arial' COLOR='navy'>" . "EDIT" . "</font>" . "\r\n";
            $strDataTable = $strDataTable . "</a>" . "\r\n";
            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //Change Column name as required
            //May have to check Loaded_Machine for NULL, if it is not mandatory.
            //--------------------------------------------------------------------------------------------------------------------------------------------
            if (odbc_result($process2,"Array_Name") == ""
                   || (strlen(odbc_result($process2,"Array_Name")) == 0))      
            {
                $strStartDate = "&nbsp;";
            }
            else
            {
                $strStartDate = odbc_result($process2,"Array_Name");
            }

            //$strDataTable = $strDataTable . "<td ALIGN='left' WIDTH='160px'" . "\r\n";
            //$strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid white;" . "\r\n";
            //$strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            //$strDataTable = $strDataTable . " BORDER-LEFT: 1px solid silver;" . "\r\n";
            //$strDataTable = $strDataTable . " FONT-SIZE: 11px;" . "\r\n";
            //$strDataTable = $strDataTable . " FONT-FAMILY: Arial;" . "\r\n";
            //$strDataTable = $strDataTable . " COLOR: black;" . "\r\n";
            //$strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid white'>" . "\r\n";
            //$strDataTable = $strDataTable . "" . "<b><a style='text-decoration:none;color:black' href='JavaScript: Detail1(" . '"' . odbc_result($process2,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            //$strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            //$strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex=\'-1\' title=\'Array Name\' " . " >" . "\r\n";
            //$strDataTable = $strDataTable . $strStartDate . "\r\n";
            //$strDataTable = $strDataTable . "</a></b>" . "\r\n";
            //$strDataTable = $strDataTable . "</td>" . "\r\n";
            //OR if want to edit field on the fly
            //---------------------------------------------------------------------------
            $strsize2 = "12";
            $strDataTable = $strDataTable . "<td ALIGN='left' WIDTH='155px'" . "\r\n";
            $strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid white;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid white'>" . "\r\n";
            // Note:- Change id=aa if other checkboxes or fields updated on the fly
            $strDataTable = $strDataTable . " <INPUT id=aa" . $intcounter . "c7 type='text'  " . "\r\n";
            $strDataTable = $strDataTable . " style='WIDTH: 142px;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-WEIGHT: bold;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-FAMILY: arial;" . "\r\n";
            $strDataTable = $strDataTable . " COLOR: black;" . "\r\n";
            $strDataTable = $strDataTable . " TEXT-ALIGN: left;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-SIZE: " . $strsize2 . "px ' " . "\r\n";
            $strDataTable = $strDataTable . "onclick='Detail12(" . '"' . odbc_result($process2,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ");' " . "\r\n";
            $strDataTable = $strDataTable . "onchange='updatefield(" . '"' . odbc_result($process2,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ");' " . " value= " . '"' . $strStartDate . '"' . " >" . "\r\n";
            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

 

            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //Change Column name as required
            //May have to check Loaded_Machine for NULL, if it is not mandatory.
            //-------------------------------------------------------------------------------------------------------------------------------------------
            if (odbc_result($process2,"Loaded_Machine") == ""
                   || (strlen(odbc_result($process2,"Loaded_Machine")) == 0))      
            {
                $strStartDate = "&nbsp;";
            }
            else
            {
                $strStartDate = odbc_result($process2,"Loaded_Machine");
            }

            $strDataTable = $strDataTable . "<td ALIGN='left' WIDTH='150px'" . "\r\n";
            $strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid white;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-SIZE: 11px;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-FAMILY: Arial;" . "\r\n";
            $strDataTable = $strDataTable . " COLOR: black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid white'>" . "\r\n";
            $strDataTable = $strDataTable . "" . "<a style='text-decoration:none;color:black' href='JavaScript: Detail1(" . '"' . odbc_result($process2,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Array Name' " . " >" . "\r\n";
            //$strDataTable = $strDataTable . "  <font size='2' face='Arial' color='black'>" . "\r\n";
            $strDataTable = $strDataTable . $strStartDate . "\r\n";
            //$strDataTable = $strDataTable . "</font>" . "\r\n";
            $strDataTable = $strDataTable . "</a>" . "\r\n";
            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&



            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //Change Column name as required
            //May have to check End Date for NULL, if it is not mandatory.
            //--------------------------------------------------------------------------------------------------------------------------------------------
            if (odbc_result($process2,"Start_Date") == ""
                   || (strlen(odbc_result($process2,"Start_Date")) == 0))      
            {
                $strStartDate = "&nbsp;";
            }
            else
            {
               $strStartDate = odbc_result($process2,"Start_Date");

               $strstartlen = strlen($strStartDate);
               //$strstartmonth = substr($strStartDate,start,length);
               $strstartyear = substr($strStartDate,0,4);
               $strstartmonth = substr($strStartDate,5,2);
               $strstartday = substr($strStartDate,8,2);

               // hour, minute, second,month,day,year
               //$my_birthday = gmmktime(0,0,0,10,3,1975);
               $my_birthday = gmmktime(0,0,0,$strstartmonth,$strstartday,$strstartyear );
                //print(date("M-d-Y",$my_birthday));
               //$strStartDate = date("m-d-Y",$my_birthday);
               $strStartDate = date("d/m/Y",$my_birthday);

            }

            $strDataTable = $strDataTable . "<td ALIGN='left' WIDTH='90px'" . "\r\n";
            $strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid white;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-SIZE: 11px;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-FAMILY: Arial;" . "\r\n";
            $strDataTable = $strDataTable . " COLOR: black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid white'>" . "\r\n";
            
            //$strDataTable = $strDataTable . "" . "<a style='text-decoration:none;color:black' href='JavaScript: Detail1(" . '"' . odbc_result($process2,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            //$strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            //$strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Array Name' " . " >" . "\r\n";
            //$strDataTable = $strDataTable . $strStartDate . "\r\n";
            //$strDataTable = $strDataTable . "</a>" . "\r\n";

            // next 6 lines are for updating date on the fly Option
            $strdatename = "Start_Date";
            $strDataTable = $strDataTable . "<a href='JavaScript: calendarpopup(" . '"' . odbc_result($process2,"PK_ID") . '"' . "," . '"' . $strdatename . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Title' " . " >" . "\r\n";
            $strDataTable = $strDataTable . $strStartDate . "\r\n";
            $strDataTable = $strDataTable . "</a>" . "\r\n";

            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


        
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //Change Column name as required
            //May have to check End Date for NULL, if it is not mandatory.
            //--------------------------------------------------------------------------------------------------------------------------------------------
            if (odbc_result($process2,"End_Date") == ""
                   || (strlen(odbc_result($process2,"End_Date")) == 0))      
            {
                $strStartDate = "&nbsp;";
            }
            else
            {
               $strStartDate = odbc_result($process2,"End_Date");

               $strstartyear = substr($strStartDate,0,4);
               $strstartmonth = substr($strStartDate,5,2);
               $strstartday = substr($strStartDate,8,2);

               // hour, minute, second,month,day,year
               //$my_birthday = gmmktime(0,0,0,10,3,1975);
               $my_birthday = gmmktime(0,0,0,$strstartmonth,$strstartday,$strstartyear );
                //print(date("M-d-Y",$my_birthday));
               //$strStartDate = date("m-d-Y",$my_birthday);
               $strStartDate = date("d/m/Y",$my_birthday);
            }

            $strDataTable = $strDataTable . "<td ALIGN='left' WIDTH='90px'" . "\r\n";
            $strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid white;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-SIZE: 11px;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-FAMILY: Arial;" . "\r\n";
            $strDataTable = $strDataTable . " COLOR: black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid white'>" . "\r\n";
            
            //$strDataTable = $strDataTable . "" . "<a style='text-decoration:none;color:black' href='JavaScript: Detail1(" . '"' . odbc_result($process2,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            //$strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            //$strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Array Name' " . " >" . "\r\n";
            //$strDataTable = $strDataTable . $strStartDate . "\r\n";
            //$strDataTable = $strDataTable . "</a>" . "\r\n";

            // next 6 lines are for updating date on the fly Option
            $strdatename = "End_Date";
            $strDataTable = $strDataTable . "<a href='JavaScript: calendarpopup(" . '"' . odbc_result($process2,"PK_ID") . '"' . "," . '"' . $strdatename . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Title' " . " >" . "\r\n";
            $strDataTable = $strDataTable . $strStartDate . "\r\n";
            $strDataTable = $strDataTable . "</a>" . "\r\n";

            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&



            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //NOTE:- OPTIONAL - MUST TAKE OUT IF NOT USING A CheckBox in List (Also must adjust Table width size again)
            //CheckBox Column, PK_ID may have to change
            //-----------------------------------------------------
            if (odbc_result($process2,"Complete_Flag") == ""
                   || (strlen(odbc_result($process2,"Complete_Flag")) == 0))      
            {
                $strFlag = "";
            }
            else
            {
                $strBoolean = odbc_result($process2,"Complete_Flag");
                if ($strBoolean == "True")
                {
                    $strFlag = "CHECKED";
                }
                else
                {
                    $strFlag = "";
                }
            }

            $strDataTable = $strDataTable . "<td ALIGN=center WIDTH=110px" . "\r\n";
            $strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid white;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-SIZE: 10px;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid silver'>" . "\r\n";
            $strDataTable = $strDataTable . " <INPUT id=r" . $intcounter . "c7 type='checkbox'  " . "\r\n";
            $strDataTable = $strDataTable . "onclick='chkclick(" . '"' . odbc_result($process2,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ");' " . " value='Yes' " . $strFlag . " >" . "\r\n";
            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&



            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //NOTE:- OPTIONAL - MUST TAKE OUT IF NOT USING A DELETE Button in List (Also must adjust Table width size again)
            //DELETE Column, PK_ID may have to change, Array_Name may have to change, so as to show what is being Deleted
            //--------------------------------------------------------------------------------------------------------------------------------------------
            $strDataTable = $strDataTable . "<td ALIGN=center WIDTH=37px" . "\r\n";
            $strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid white;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid silver'>" . "\r\n";
            $strDataTable = $strDataTable . "<a href='JavaScript: DelClick(" . '"' . odbc_result($process2,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . "," . '"' . odbc_result($process2,"Array_Name") . '"' . ")' " . " tabIndex='-1' title='Title' " . " >" . "\r\n";
            //$strDataTable = $strDataTable . " <img SRC='./images/DEL_04.gif' ALT='Delete Array' TITLE='Delete Array' WIDTH=33px HEIGHT=21px border" ."='0'> " . "\r\n";
            $strDataTable = $strDataTable . "<font size=1 face='Arial' color='red'>" . "Del" . "</font>" . "\r\n";
            $strDataTable = $strDataTable . "</a>" . "\r\n";
            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&



            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //KEY Column, PK_ID may have to change, must make visibility = hidden 
            // NOTE:-  Can change hidden  -->   visible, for displaying variables below
            //-----------------------------------------------------------------------------------
            $strDataTable = $strDataTable . "<td WIDTH='245px'" . "\r\n";
            $strDataTable = $strDataTable . " style='display: none;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-TOP: 1px solid black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid black'>" . "\r\n";
            $strDataTable = $strDataTable . " <font size='1'>" . "\r\n";
            $strDataTable = $strDataTable . odbc_result($process2,"PK_ID") . "\r\n";
            $strDataTable = $strDataTable . "</font>" . "\r\n";
            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

            $strDataTable = $strDataTable . "<td id='row6'  WIDTH='10px'" . "\r\n";
            $strDataTable = $strDataTable . " style='display: none;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-TOP: 1px solid black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid black'>" . "\r\n";
            $strDataTable = $strDataTable . " <font size='1'>" . "\r\n";
            $strDataTable = $strDataTable . $intcounter . "\r\n";
            $strDataTable = $strDataTable . "</font>" . "\r\n";
            $strDataTable = $strDataTable . "</td>" . "\r\n";

            //END of ROW
            $strDataTable = $strDataTable . "</tr>" . "\r\n";


           // if ($intcounter == 99)
            //{
                //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                //PK_ID may have to change
                //--------------------------------
                //STORE PK_ID HIDDEN value ready to display
                //$strDispPKID = $this->DispPKIDInfo(odbc_result($process2,"PK_ID"));
                //echo $strDispPKID;
                //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //}



            //$intcounter = $intcounter + 1;

        }      //end while



        odbc_close($sqlconnect2);

       }
     //DOING Showing updated record on TOP if BIG Table  using $strPKIDNEW  as PKID to search
     //==============================================================================================================





        $sqlconnect=odbc_connect($dsn,$username,$password);

        //$sqlquery="SELECT top 10 Array_Name, Loaded_Machine, Start_Date, PK_ID FROM ARRAYS2;";


        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
        $strTable = "ARRAYS2";
        $strPK = "PK_ID";
        //$strsort = "";

        $strsort = " ORDER BY " . $strSortField . " ";
        $strFields = "PK_ID, Array_Name, Loaded_Machine, Complete_Flag, Start_Date, End_Date";

        $strfiltercheck = "";
        $intwherecounter = 0;


        //Add Search criteria, or take out if not using search criteria
        //-----------------------------------------------------------------------------------

        if ($strarraysearch == ""
                    || (strlen($strarraysearch) == 0))
        {
            // nothing to Search
        }
        else
        {
            // NOTE:- To make faster, put % only at end
            $strfiltercheck = $strfiltercheck . " Array_Name like '%"
                        . $strarraysearch . "%'";
            $intwherecounter = 1;
        }

        if ($strmachsearch == ""
                    || (strlen($strmachsearch) == 0))
        {
            // nothing to Search
        }
        else if ($intwherecounter == 1)
        {
            $strfiltercheck = $strfiltercheck . " AND Loaded_Machine = '"
                        . $strmachsearch . "'";
        }
        else
        {
            $strfiltercheck = $strfiltercheck . " Loaded_Machine = '"
                        . $strmachsearch . "'";
        }
  
        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


        if ($strfiltercheck == "")
        {
            $strfilter = "";
            $strsimplefilter = "";
        }
        else
        {
            $strfilter = " WHERE " . $strfiltercheck;
            $strsimplefilter = " AND " . $strfiltercheck;
        }


        //Check if on First Page, to determine what Query to use
        if ($intCurrentPage == 1)      //at first page
        {
            $strSQL = "SELECT TOP " . $intPageSize . " " . $strFields . " FROM " . $strTable
               . $strfilter . $strsort;
        }
        else
        {
            $strSQL = "SELECT TOP " . $intPageSize . " " . $strFields . " FROM " . $strTable
             . " WHERE " . $strPK . " NOT IN "
             . " (SELECT TOP " . $intSkipCount . " " . $strPK . " FROM " . $strTable
             . " " . $strfilter . $strsort . ") "
             . $strsimplefilter . $strsort;

        }


        //echo $strSQL;


        $process=odbc_exec($sqlconnect, $strSQL);

        if (!$sqlconnect)
        {
         //echo mssql_error(); 
         echo "error in Connecting";
         //die('Could not connect: ' . mssql_error());
        }
      


        //global $strDataTable;
        //$strDataTable = "";

        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
        //Must change Table width to suit Columns (always make a longer than actual calculation)
        //----------------------------------------------------------------------------------------------------------
        //$strDataTable = $strDataTable . "<table id='myTable' border='1' bgcolor='white' bordercolor='gray' cellspacing='0' cellpadding='0'  width='682" . "px'>" . "\r\n";
        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


        $intcounter = 0;
        $introwcounter = 0;
        $intsubcounter = 0;


        while(odbc_fetch_row($process))

        //while (objDR.Read())
        {

           if (odbc_result($process,"PK_ID") == $strPKIDNEW)
          {
            //skip record
             $intcounter = $intcounter + 1;
          }
          else
          {
            //Setup ROW
            $strDataTable = $strDataTable . "<tr>" . "\r\n";


            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //NOTE:- OPTIONAL - Can use hypertext on other columns instead (Also must adjust Table width size again)
            //DETAIL Column, PK_ID may have to change
            //-----------------------------------------------------
            //$strDataTable = $strDataTable . "<td ALIGN=center WIDTH=17px HEIGHT=21px" . vbCRLF
            //$strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid black;" . vbCRLF
            //$strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid black;" . vbCRLF
            //$strDataTable = $strDataTable . " BORDER-LEFT: 1px solid black;" . vbCRLF
            //$strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid black'>" . vbCRLF
            //$strDataTable = $strDataTable . "<a href='JavaScript: Detail1(" . chr(34) . objDR.Item("PK_ID") . chr(34) . "," . chr(34) . $intcounter . chr(34) .  "," 
            //$strDataTable = $strDataTable . chr(34) . $intCurrentPage . chr(34) . "," . chr(34) . $intSkipCount . chr(34) . "," 
            //$strDataTable = $strDataTable . chr(34) . $strSortField . chr(34) . "," . chr(34) . $intPageSize . chr(34) . ")' " . " tabIndex='-1' title='Title' " .  " >" . vbCRLF
            //     $strDataTable = $strDataTable . " <img SRC='./images/DETAIL_04.gif' ALT='Array Details' TITLE='Array Details' WIDTH=50px HEIGHT=21px border='0'> " . vbCRLF
            //$strDataTable = $strDataTable . " <img SRC='./images/DETAIL_08.bmp' ALT='Array Details' TITLE='Array Details' WIDTH=8px HEIGHT=13px border='0'> " . vbCRLF
            //$strDataTable = $strDataTable . "</a>" . vbCRLF
            //$strDataTable = $strDataTable . "</td>" . vbCRLF

            $strDataTable = $strDataTable . "<td ALIGN='center' WIDTH='45px' HEIGHT='21px'" . "\r\n";
            $strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-SIZE: 11px;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-FAMILY: Arial;" . "\r\n";
            $strDataTable = $strDataTable . " COLOR: navy;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid white'>" . "\r\n";
            $strDataTable = $strDataTable . "<a href='JavaScript: Detail1(" . '"' . odbc_result($process,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Title' " . " >" . "\r\n";
            //$strDataTable = $strDataTable . " <img SRC='./images/DETAIL_04.gif' ALT='Array Details' TITLE='Array Details' WIDTH=50px HEIGHT=21px b" ."order='0'> " . "\r\n";
            //$strDataTable = $strDataTable . " <img SRC='./images/DETAIL_08.bmp' ALT='Array Details' TITLE='Array Details' WIDTH=8px HEIGHT=13px bo" ."rder='0'> " . "\r\n";
            $strDataTable = $strDataTable . "EDIT" . "\r\n";
            //$strDataTable = $strDataTable . "  " . "<font SIZE='1' FACE='Arial' COLOR='navy'>" . "EDIT" . "</font>" . "\r\n";
            $strDataTable = $strDataTable . "</a>" . "\r\n";
            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //Change Column name as required
            //May have to check Loaded_Machine for NULL, if it is not mandatory.
            //--------------------------------------------------------------------------------------------------------------------------------------------
            if (odbc_result($process,"Array_Name") == ""
                   || (strlen(odbc_result($process,"Array_Name")) == 0))      
            {
                $strStartDate = "&nbsp;";
            }
            else
            {
                $strStartDate = odbc_result($process,"Array_Name");
            }

            //$strDataTable = $strDataTable . "<td ALIGN='left' WIDTH='160px'" . "\r\n";
            //$strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid white;" . "\r\n";
            //$strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            //$strDataTable = $strDataTable . " BORDER-LEFT: 1px solid silver;" . "\r\n";
            //$strDataTable = $strDataTable . " FONT-SIZE: 11px;" . "\r\n";
            //$strDataTable = $strDataTable . " FONT-FAMILY: Arial;" . "\r\n";
            //$strDataTable = $strDataTable . " COLOR: black;" . "\r\n";
            //$strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid white'>" . "\r\n";
            //$strDataTable = $strDataTable . "" . "<b><a style='text-decoration:none;color:black' href='JavaScript: Detail1(" . '"' . odbc_result($process,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            //$strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            //$strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex=\'-1\' title=\'Array Name\' " . " >" . "\r\n";
            //$strDataTable = $strDataTable . $strStartDate . "\r\n";
            //$strDataTable = $strDataTable . "</a></b>" . "\r\n";
            //$strDataTable = $strDataTable . "</td>" . "\r\n";
            //OR if want to edit field on the fly
            //---------------------------------------------------------------------------
            $strsize2 = "12";
            $strDataTable = $strDataTable . "<td ALIGN='left' WIDTH='155px'" . "\r\n";
            $strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid white;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid white'>" . "\r\n";
            // Note:- Change id=aa if other checkboxes or fields updated on the fly
            $strDataTable = $strDataTable . " <INPUT id=aa" . $intcounter . "c7 type='text'  " . "\r\n";
            $strDataTable = $strDataTable . " style='WIDTH: 142px;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-WEIGHT: bold;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-FAMILY: arial;" . "\r\n";
            $strDataTable = $strDataTable . " COLOR: black;" . "\r\n";
            $strDataTable = $strDataTable . " TEXT-ALIGN: left;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-SIZE: " . $strsize2 . "px ' " . "\r\n";
            $strDataTable = $strDataTable . "onclick='Detail12(" . '"' . odbc_result($process,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ");' " . "\r\n";
            $strDataTable = $strDataTable . "onchange='updatefield(" . '"' . odbc_result($process,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ");' " . " value= " . '"' . $strStartDate . '"' . " >" . "\r\n";
            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

 

            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //Change Column name as required
            //May have to check Loaded_Machine for NULL, if it is not mandatory.
            //-------------------------------------------------------------------------------------------------------------------------------------------
            if (odbc_result($process,"Loaded_Machine") == ""
                   || (strlen(odbc_result($process,"Loaded_Machine")) == 0))      
            {
                $strStartDate = "&nbsp;";
            }
            else
            {
                $strStartDate = odbc_result($process,"Loaded_Machine");
            }

            $strDataTable = $strDataTable . "<td ALIGN='left' WIDTH='150px'" . "\r\n";
            $strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid white;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-SIZE: 11px;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-FAMILY: Arial;" . "\r\n";
            $strDataTable = $strDataTable . " COLOR: black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid white'>" . "\r\n";
            $strDataTable = $strDataTable . "" . "<a style='text-decoration:none;color:black' href='JavaScript: Detail1(" . '"' . odbc_result($process,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Array Name' " . " >" . "\r\n";
            //$strDataTable = $strDataTable . "  <font size='2' face='Arial' color='black'>" . "\r\n";
            $strDataTable = $strDataTable . $strStartDate . "\r\n";
            //$strDataTable = $strDataTable . "</font>" . "\r\n";
            $strDataTable = $strDataTable . "</a>" . "\r\n";
            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&



            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //Change Column name as required
            //May have to check End Date for NULL, if it is not mandatory.
            //--------------------------------------------------------------------------------------------------------------------------------------------
            if (odbc_result($process,"Start_Date") == ""
                   || (strlen(odbc_result($process,"Start_Date")) == 0))      
            {
                $strStartDate = "&nbsp;";
            }
            else
            {
               $strStartDate = odbc_result($process,"Start_Date");

               $strstartlen = strlen($strStartDate);
               //$strstartmonth = substr($strStartDate,start,length);
               $strstartyear = substr($strStartDate,0,4);
               $strstartmonth = substr($strStartDate,5,2);
               $strstartday = substr($strStartDate,8,2);

               // hour, minute, second,month,day,year
               //$my_birthday = gmmktime(0,0,0,10,3,1975);
               $my_birthday = gmmktime(0,0,0,$strstartmonth,$strstartday,$strstartyear );
                //print(date("M-d-Y",$my_birthday));
               //$strStartDate = date("m-d-Y",$my_birthday);
               $strStartDate = date("d/m/Y",$my_birthday);

            }

            $strDataTable = $strDataTable . "<td ALIGN='left' WIDTH='90px'" . "\r\n";
            $strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid white;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-SIZE: 11px;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-FAMILY: Arial;" . "\r\n";
            $strDataTable = $strDataTable . " COLOR: black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid white'>" . "\r\n";
            
            //$strDataTable = $strDataTable . "" . "<a style='text-decoration:none;color:black' href='JavaScript: Detail1(" . '"' . odbc_result($process,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            //$strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            //$strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Array Name' " . " >" . "\r\n";
            //$strDataTable = $strDataTable . $strStartDate . "\r\n";
            //$strDataTable = $strDataTable . "</a>" . "\r\n";

            // next 6 lines are for updating date on the fly Option
            $strdatename = "Start_Date";
            $strDataTable = $strDataTable . "<a href='JavaScript: calendarpopup(" . '"' . odbc_result($process,"PK_ID") . '"' . "," . '"' . $strdatename . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Title' " . " >" . "\r\n";
            $strDataTable = $strDataTable . $strStartDate . "\r\n";
            $strDataTable = $strDataTable . "</a>" . "\r\n";

            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


        
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //Change Column name as required
            //May have to check End Date for NULL, if it is not mandatory.
            //--------------------------------------------------------------------------------------------------------------------------------------------
            if (odbc_result($process,"End_Date") == ""
                   || (strlen(odbc_result($process,"End_Date")) == 0))      
            {
                $strStartDate = "&nbsp;";
            }
            else
            {
               $strStartDate = odbc_result($process,"End_Date");

               $strstartyear = substr($strStartDate,0,4);
               $strstartmonth = substr($strStartDate,5,2);
               $strstartday = substr($strStartDate,8,2);

               // hour, minute, second,month,day,year
               //$my_birthday = gmmktime(0,0,0,10,3,1975);
               $my_birthday = gmmktime(0,0,0,$strstartmonth,$strstartday,$strstartyear );
                //print(date("M-d-Y",$my_birthday));
               //$strStartDate = date("m-d-Y",$my_birthday);
               $strStartDate = date("d/m/Y",$my_birthday);
            }

            $strDataTable = $strDataTable . "<td ALIGN='left' WIDTH='90px'" . "\r\n";
            $strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid white;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-SIZE: 11px;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-FAMILY: Arial;" . "\r\n";
            $strDataTable = $strDataTable . " COLOR: black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid white'>" . "\r\n";
            
            //$strDataTable = $strDataTable . "" . "<a style='text-decoration:none;color:black' href='JavaScript: Detail1(" . '"' . odbc_result($process,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            //$strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            //$strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Array Name' " . " >" . "\r\n";
            //$strDataTable = $strDataTable . $strStartDate . "\r\n";
            //$strDataTable = $strDataTable . "</a>" . "\r\n";

            // next 6 lines are for updating date on the fly Option
            $strdatename = "End_Date";
            $strDataTable = $strDataTable . "<a href='JavaScript: calendarpopup(" . '"' . odbc_result($process,"PK_ID") . '"' . "," . '"' . $strdatename . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Title' " . " >" . "\r\n";
            $strDataTable = $strDataTable . $strStartDate . "\r\n";
            $strDataTable = $strDataTable . "</a>" . "\r\n";

            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&



            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //NOTE:- OPTIONAL - MUST TAKE OUT IF NOT USING A CheckBox in List (Also must adjust Table width size again)
            //CheckBox Column, PK_ID may have to change
            //-----------------------------------------------------
            if (odbc_result($process,"Complete_Flag") == ""
                   || (strlen(odbc_result($process,"Complete_Flag")) == 0))      
            {
                $strFlag = "";
            }
            else
            {
                $strBoolean = odbc_result($process,"Complete_Flag");
                if ($strBoolean == "True")
                {
                    $strFlag = "CHECKED";
                }
                else
                {
                    $strFlag = "";
                }
            }

            $strDataTable = $strDataTable . "<td ALIGN=center WIDTH=110px" . "\r\n";
            $strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid white;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " FONT-SIZE: 10px;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid silver'>" . "\r\n";
            $strDataTable = $strDataTable . " <INPUT id=r" . $intcounter . "c7 type='checkbox'  " . "\r\n";
            $strDataTable = $strDataTable . "onclick='chkclick(" . '"' . odbc_result($process,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ");' " . " value='Yes' " . $strFlag . " >" . "\r\n";
            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&



            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //NOTE:- OPTIONAL - MUST TAKE OUT IF NOT USING A DELETE Button in List (Also must adjust Table width size again)
            //DELETE Column, PK_ID may have to change, Array_Name may have to change, so as to show what is being Deleted
            //--------------------------------------------------------------------------------------------------------------------------------------------
            $strDataTable = $strDataTable . "<td ALIGN=center WIDTH=37px" . "\r\n";
            $strDataTable = $strDataTable . " style='BORDER-TOP: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid silver;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid white;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid silver'>" . "\r\n";
            $strDataTable = $strDataTable . "<a href='JavaScript: DelClick(" . '"' . odbc_result($process,"PK_ID") . '"' . "," . '"' . $intcounter . '"' . ",";
            $strDataTable = $strDataTable . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
            $strDataTable = $strDataTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . "," . '"' . odbc_result($process,"Array_Name") . '"' . ")' " . " tabIndex='-1' title='Title' " . " >" . "\r\n";
            //$strDataTable = $strDataTable . " <img SRC='./images/DEL_04.gif' ALT='Delete Array' TITLE='Delete Array' WIDTH=33px HEIGHT=21px border" ."='0'> " . "\r\n";
            $strDataTable = $strDataTable . "<font size=1 face='Arial' color='red'>" . "Del" . "</font>" . "\r\n";
            $strDataTable = $strDataTable . "</a>" . "\r\n";
            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&



            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            //KEY Column, PK_ID may have to change, must make visibility = hidden 
            // NOTE:-  Can change hidden  -->   visible, for displaying variables below
            //-----------------------------------------------------------------------------------
            $strDataTable = $strDataTable . "<td WIDTH='245px'" . "\r\n";
            $strDataTable = $strDataTable . " style='display: none;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-TOP: 1px solid black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid black'>" . "\r\n";
            $strDataTable = $strDataTable . " <font size='1'>" . "\r\n";
            $strDataTable = $strDataTable . odbc_result($process,"PK_ID") . "\r\n";
            $strDataTable = $strDataTable . "</font>" . "\r\n";
            $strDataTable = $strDataTable . "</td>" . "\r\n";
            //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

            $strDataTable = $strDataTable . "<td id='row6'  WIDTH='10px'" . "\r\n";
            $strDataTable = $strDataTable . " style='display: none;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-TOP: 1px solid black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-BOTTOM: 1px solid black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-LEFT: 1px solid black;" . "\r\n";
            $strDataTable = $strDataTable . " BORDER-RIGHT: 1px solid black'>" . "\r\n";
            $strDataTable = $strDataTable . " <font size='1'>" . "\r\n";
            $strDataTable = $strDataTable . $intcounter . "\r\n";
            $strDataTable = $strDataTable . "</font>" . "\r\n";
            $strDataTable = $strDataTable . "</td>" . "\r\n";

            //END of ROW
            $strDataTable = $strDataTable . "</tr>" . "\r\n";


            if ($intcounter == 0)
            {
                //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                //PK_ID may have to change
                //--------------------------------
                //STORE PK_ID HIDDEN value ready to display
                $strDispPKID = $this->DispPKIDInfo(odbc_result($process,"PK_ID"));
                echo $strDispPKID;
                //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
            }



            $intcounter = $intcounter + 1;

            // if ($intsubcounter == $intPageSize)      //stop reading if got page full  
            // {
            //     break;
            // }

         }

        }      //end while



        odbc_close($sqlconnect);

        $strDataTable = $strDataTable . "</table>" . "\r\n";

        echo $strDataTable;


    }



//===================================================================================================================
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


    //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
    //Can add more Search criteria, other than $strarraysearch, $strmachsearch (using by default 2)
    function GetHeaderTable($strarraysearch, $strmachsearch, $intPageSize, $intCurrentPage, $intRowID, $intSkipCount, $strSortField)
    {

        //  This must match the Table from the above Function GetPageOfRecords()
        //  Can be modified to suit
        // --------------------------------------------------------------------------------------------------------------------------------------------------------------
        //response.write(("in GetHeaderTable " + "<br>\""));
        global $strHeaderTable;
        $strHeaderTable = "";
        $strHeaderTable = $strHeaderTable . "<table id='myHeader' border='0' bgcolor='white' bordercolor='gray' cellspacing='0' cellpadding='0' width='682" . "px'>" . "\r\n";
        // &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
        $strHeaderTable = $strHeaderTable . "<tr>" . "\r\n";

        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
        //NOTE:- OPTIONAL - MUST TAKE OUT IF NOT USING A ADD Button in List (Also must adjust Table width size again)
        //----------------------------------------------------------------------------------------------------------------------------------------
        $strHeaderTable = $strHeaderTable . "<th ALIGN='center' WIDTH='47px' HEIGHT='24px' BGCOLOR='white' BORDERCOLOR='gray' " . "\r\n";
        $strHeaderTable = $strHeaderTable . " style='BORDER-TOP: 0px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-BOTTOM: 0px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-LEFT: 0px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-RIGHT: 0px solid gray'>" . "\r\n";
        $strHeaderTable = $strHeaderTable . "<a href='JavaScript: Add1(" . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
        $strHeaderTable = $strHeaderTable . '"' . $strSortField . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Add' " . " >" . "\r\n";
        $strHeaderTable = $strHeaderTable . " " . "\r\n";
        //$strHeaderTable = $strHeaderTable . " ADD " . "\r\n";
        //$strHeaderTable = $strHeaderTable . " <img SRC='./images/ADD_04.gif' ALT='Add Array' WIDTH=45px HEIGHT=25px border='0'> " . "\r\n";
        $strHeaderTable = $strHeaderTable . "</a>" . "\r\n";
        $strHeaderTable = $strHeaderTable . "</th>" . "\r\n";



        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
        //Column acting as a SORT, Array_Name, PK_ID may have to change to suit Sort Index
        //---------------------------------------------------------------------------------------------------------
        $strHeaderTable = $strHeaderTable . "<th ALIGN='left' WIDTH='160px' id = " . '"' . "Array_Name asc, PK_ID" . '"' . " BGCOLOR='#006699' BORDERCOLOR='gray' " . "\r\n";
        $strHeaderTable = $strHeaderTable . " style='BORDER-TOP: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-BOTTOM: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-LEFT: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " FONT-SIZE: 12px;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " FONT-FAMILY: Arial;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " COLOR: white;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-RIGHT: 1px solid gray'>" . "\r\n";
        $strHeaderTable = $strHeaderTable . "" . "<a style='text-decoration:underline;color:white' href='JavaScript: Sort1(" . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
        $strHeaderTable = $strHeaderTable . '"' . "Array_Name asc, PK_ID" . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Array' " . " >" . "\r\n";
        $strHeaderTable = $strHeaderTable . " Array Name" . "\r\n";
        $strHeaderTable = $strHeaderTable . "</a>" . "\r\n";

        $strHeaderTable = $strHeaderTable . "<span id='Array_Name asc, PK_IDasc' style='display:none;padding:4px;color:yellow'>" . "\r\n";
        $strHeaderTable = $strHeaderTable . "asc" . "\r\n";
        $strHeaderTable = $strHeaderTable . "</span>" . "\r\n";

        $strHeaderTable = $strHeaderTable . "<span id='Array_Name asc, PK_IDdesc' style='display:none;padding:4px;color:yellow'>" . "\r\n";
        $strHeaderTable = $strHeaderTable . "desc" . "\r\n";
        $strHeaderTable = $strHeaderTable . "</span>" . "\r\n";
        
        $strHeaderTable = $strHeaderTable . "</th>" . "\r\n";
        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
        //Column acting as a SORT, Loaded_Machine, PK_ID may have to change to suit Sort Index
        //---------------------------------------------------------------------------------------------------------
        $strHeaderTable = $strHeaderTable . "<th ALIGN='left' WIDTH='150px' id = " . '"' . "Loaded_Machine asc, PK_ID" . '"' . " BGCOLOR='#006699' BORDERCOLOR='gray' " . "\r\n";
        $strHeaderTable = $strHeaderTable . " style='BORDER-TOP: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-BOTTOM: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-LEFT: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " FONT-SIZE: 12px;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " FONT-FAMILY: Arial;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " COLOR: white;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-RIGHT: 1px solid gray'>" . "\r\n";
        $strHeaderTable = $strHeaderTable . "" . "<a style='text-decoration:underline;color:white' href='JavaScript: Sort1(" . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
        $strHeaderTable = $strHeaderTable . '"' . "Loaded_Machine asc, PK_ID" . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Machine' " . " >" . "\r\n";
        $strHeaderTable = $strHeaderTable . "Machine" . "\r\n";
        $strHeaderTable = $strHeaderTable . "</a>" . "\r\n";
        $strHeaderTable = $strHeaderTable . "</th>" . "\r\n";
        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
        //Column acting as a SORT, START_DATE desc, PK_ID may have to change to suit Sort Index
        //--------------------------------------------------------------------------------------------------------------
        $strHeaderTable = $strHeaderTable . "<th ALIGN='left' WIDTH='90px' id = " . '"' . "Start_Date asc, PK_ID" . '"' . " BGCOLOR='#006699' BORDERCOLOR='gray' " . "\r\n";
        $strHeaderTable = $strHeaderTable . " style='BORDER-TOP: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-BOTTOM: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-LEFT: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " FONT-SIZE: 12px;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " FONT-FAMILY: Arial;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " COLOR: white;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-RIGHT: 1px solid gray'>" . "\r\n";
        $strHeaderTable = $strHeaderTable . "" . "<a style='text-decoration:underline;color:white' href='JavaScript: Sort1(" . '"' . $intCurrentPage . '"' . "," . '"' . $intSkipCount . '"' . ",";
        $strHeaderTable = $strHeaderTable . '"' . "Start_Date asc, PK_ID" . '"' . "," . '"' . $intPageSize . '"' . ")' " . " tabIndex='-1' title='Machine' " . " >" . "\r\n";
        $strHeaderTable = $strHeaderTable . "Start Date" . "\r\n";
        $strHeaderTable = $strHeaderTable . "</a>" . "\r\n";
        $strHeaderTable = $strHeaderTable . "</th>" . "\r\n";
        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
        //Change Column name as required
        //----------------------------------------
        $strHeaderTable = $strHeaderTable . "<th ALIGN='left' WIDTH='90px' BGCOLOR='#006699' BORDERCOLOR='gray' " . "\r\n";
        $strHeaderTable = $strHeaderTable . " style='BORDER-TOP: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-BOTTOM: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-LEFT: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " FONT-SIZE: 12px;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " FONT-FAMILY: Arial;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " COLOR: white;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-RIGHT: 1px solid gray'>" . "\r\n";
        $strHeaderTable = $strHeaderTable . "End Date" . "\r\n";
        $strHeaderTable = $strHeaderTable . "</th>" . "\r\n";
        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
        //Change Column name as required
        //----------------------------------------
        $strHeaderTable = $strHeaderTable . "<th ALIGN='center' WIDTH='110px' BGCOLOR='#006699' BORDERCOLOR='gray' " . "\r\n";
        $strHeaderTable = $strHeaderTable . " style='BORDER-TOP: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-BOTTOM: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-LEFT: 1px solid gray;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " FONT-SIZE: 12px;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " FONT-FAMILY: Arial;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " COLOR: white;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-RIGHT: 1px solid gray'>" . "\r\n";
        $strHeaderTable = $strHeaderTable . "Complete Flag" . "\r\n";
        $strHeaderTable = $strHeaderTable . "</th>" . "\r\n";
        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
        //NOTE:- OPTIONAL - MUST TAKE OUT IF NOT USING A DELETE Button in List (Also must adjust Table width size again)
        //ALSO, adjust this Blank column size to suit, if say the Add button is not used (ie 37 + 57 = 94) OR nothing at all.
        //---------------------------------------------------------------------------------------------------------------------------------------------
        $strHeaderTable = $strHeaderTable . "<th ALIGN=left WIDTH=37px BGCOLOR=white BORDERCOLOR=white " . "\r\n";
        $strHeaderTable = $strHeaderTable . " style='BORDER-TOP: 1px solid white;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-BOTTOM: 1px solid white;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-LEFT: 1px solid white;" . "\r\n";
        $strHeaderTable = $strHeaderTable . " BORDER-RIGHT: 1px solid white'>" . "\r\n";
        $strHeaderTable = $strHeaderTable . "<font size=2 face='Arial' COLOR='white'>" . "\r\n";
        $strHeaderTable = $strHeaderTable . " " . "\r\n";
        $strHeaderTable = $strHeaderTable . "</font>" . "\r\n";
        $strHeaderTable = $strHeaderTable . "</th>" . "\r\n";
        //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


        $strHeaderTable = $strHeaderTable . "</tr>" . "\r\n";
        $strHeaderTable = $strHeaderTable . "</table>" . "\r\n";

         echo $strHeaderTable;
      }







     
    function ajaxgridNOTUSEDAction()
    {
        $this->_helper->viewRenderer->setNoRender();
        echo "GajaxgridAction";
        
		$action =  $_REQUEST['action'];

        echo $action;

        //$state = $_REQUEST['state'];

        //if ($state == 'do')
        //{
          //  echo '<h1>exciting text retrieved from server!</h1>';
        //}
        //else if ($state == 'undo')
       // {
           // echo 'reset to boring ...';
        //}
        //else
        //{
            //echo "unknown state parameter passed to server!!";
       // }

    }








}

?>
